import { IContext, IUIService } from '@/core';
/**
 * 界面服务注册中心
 * 基于template/src/register/ui-service-register.ts.hbs生成
 *
 * @export
 * @class UIServiceRegister
 */
export class UIServiceRegister {

	/**
	 * 界面服务注册中心对象
	 *
	 * @private
	 * @static
	 * @type {UIServiceRegister}
	 * @memberof UIServiceRegister
	 */
	private static register: UIServiceRegister;

	/**
	 * Creates an instance of UIServiceRegister.
	 * 禁止使用new获取界面服务注册中心对象
	 * @memberof UIServiceRegister
	 */
	private constructor() {}

	/**
	 * 获取实体服务注册中心对象
	 *
	 * @static
	 * @return {*}  {UIServiceRegister}
	 * @memberof UIServiceRegister
	 */
	static getInstance(): UIServiceRegister {
		if (!this.register) {
			this.register = new UIServiceRegister();
		}
		return this.register;
	}

	/**
	 * 获取界面服务
	 *
	 * @param {string} name 界面名称
	 * @param {IContext} [context={}] 应用上下文
	 * @return {*}  {Promise<any>}
	 * @memberof UIServiceRegister
	 */
	public async getService(name: string, context: IContext = {}): Promise<IUIService> {
		const targetService: any = await (this as any)[`get${name}Service`](context);
		return targetService;
	}

	/**
	 * 授权系统服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_granted_systemService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-granted-system/auth-granted-system-ui-service')).default.getInstance(context);
	}

	/**
	 * 组件使用接口服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_component_apiService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-component-api/sys-component-api-ui-service')).default.getInstance(context);
	}

	/**
	 * 授权对象服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_grantedService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-granted/auth-granted-ui-service')).default.getInstance(context);
	}

	/**
	 * 系统服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_deploy_systemService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-deploy-system/sys-deploy-system-ui-service')).default.getInstance(context);
	}

	/**
	 * 组织单元服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizational_unitService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-organizational-unit/sys-organizational-unit-ui-service')).default.getInstance(context);
	}

	/**
	 * 授权角色服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_granted_roleService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-granted-role/auth-granted-role-ui-service')).default.getInstance(context);
	}

	/**
	 * CN服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_common_nameService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-common-name/sys-common-name-ui-service')).default.getInstance(context);
	}

	/**
	 * 部门服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_departmentService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-department/sys-department-ui-service')).default.getInstance(context);
	}

	/**
	 * 登录信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuthService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth/auth-ui-service')).default.getInstance(context);
	}

	/**
	 * 认证信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_infoService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-info/auth-info-ui-service')).default.getInstance(context);
	}

	/**
	 * 数据范围服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_data_scopeService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-data-scope/sys-data-scope-ui-service')).default.getInstance(context);
	}

	/**
	 * 认证用户服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_userService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-user/auth-user-ui-service')).default.getInstance(context);
	}

	/**
	 * 菜单功能服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_menu_funcService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-menu-func/sys-menu-func-ui-service')).default.getInstance(context);
	}

	/**
	 * 接入认证绑定服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOPEN_ACCESS_AUTHService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/open-access-auth/open-access-auth-ui-service')).default.getInstance(context);
	}

	/**
	 * AD服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_active_directoryService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-active-directory/sys-active-directory-ui-service')).default.getInstance(context);
	}

	/**
	 * 系统菜单服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_menuService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-menu/sys-menu-ui-service')).default.getInstance(context);
	}

	/**
	 * 接口服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_apiService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-api/sys-api-ui-service')).default.getInstance(context);
	}

	/**
	 * 域服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_domainService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-domain/sys-domain-ui-service')).default.getInstance(context);
	}

	/**
	 * 人员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_personService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-person/sys-person-ui-service')).default.getInstance(context);
	}

	/**
	 * oauth客户端信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOAUTH_CLIENT_DETAILSService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/oauth-client-details/oauth-client-details-ui-service')).default.getInstance(context);
	}

	/**
	 * 系统角色服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_roleService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-role/sys-role-ui-service')).default.getInstance(context);
	}

	/**
	 * 用户组服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizational_roleService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-organizational-role/sys-organizational-role-ui-service')).default.getInstance(context);
	}

	/**
	 * 成员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_memberService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-member/sys-member-ui-service')).default.getInstance(context);
	}

	/**
	 * 统一认证/外部认证服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAUTH_PROVIDERService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-provider/auth-provider-ui-service')).default.getInstance(context);
	}

	/**
	 * 自定义资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_custom_resourceService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-custom-resource/sys-custom-resource-ui-service')).default.getInstance(context);
	}

	/**
	 * 角色授权资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_granted_authorityService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-granted-authority/sys-granted-authority-ui-service')).default.getInstance(context);
	}

	/**
	 * 组件服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_componentService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-component/sys-component-ui-service')).default.getInstance(context);
	}

	/**
	 * 登录日志服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAUTH_LOGService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-log/auth-log-ui-service')).default.getInstance(context);
	}

	/**
	 * 权限资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_permissionService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-permission/sys-permission-ui-service')).default.getInstance(context);
	}

	/**
	 * 开放接入服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOPEN_ACCESSService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/open-access/open-access-ui-service')).default.getInstance(context);
	}

	/**
	 * 组织机构服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizationService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-organization/sys-organization-ui-service')).default.getInstance(context);
	}

	/**
	 * GroupOfNames服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_group_of_namesService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-group-of-names/sys-group-of-names-ui-service')).default.getInstance(context);
	}

	/**
	 * 隶属信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_memberService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/auth-member/auth-member-ui-service')).default.getInstance(context);
	}

	/**
	 * 接口方法服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_api_operationService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-api-operation/sys-api-operation-ui-service')).default.getInstance(context);
	}

	/**
	 * 系统角色成员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_role_memberService(context: IContext = {}): Promise<IUIService> {
		return (await import ('@/ui-service/sys-role-member/sys-role-member-ui-service')).default.getInstance(context);
	}


}